package com.suxin.mapper;
import org.apache.ibatis.annotations.Param;

import com.suxin.domain.Good;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author Tang
 * @classname GoodsMapper
 * @description [  ]
 * @date 2021/4/1 11:20
 */
public interface GoodsMapper {

    @Results(value = {
            @Result(id = true, column = "goods_id", property = "goodsId"),
            @Result(column = "goods_name", property = "goodsName"),
            @Result(column = "goods_type", property = "goodsType")
    })
    @Select("select * from goods_0")
    public List<Good> selectAll();

    @Insert(value = {
            "insert into  goods_0 value (#{goodsId}  ,#{goodsName} ,#{goodsType} )"
    })
    public int insert(Good good);

    int insertList(@Param("list")List<Good> list);


    Good selectOne(Good good);
}
